From 3fca93af7442fb3fb9845cdb5a53ed5175facf7f Mon Sep 17 00:00:00 2001 From: tsteven4 Date: Mon, 11 Feb 2013 01:27:08 +0000 Subject: [PATCH] Make configure friendly wrt Qt on RHEL/OEL/SL/CENTOS/FEDORA. --- gpsbabel/Makefile.in | 14 ++-- gpsbabel/configure | 115 ++++++++++++++++++++++++++++--- gpsbabel/configure.in | 8 ++- gpsbabel/gui/makelinuxdist.sh.in | 4 +- 4 files changed, 125 insertions(+), 16 deletions(-) diff --git a/gpsbabel/Makefile.in b/gpsbabel/Makefile.in index 499642cb9..78dc881af 100644 --- a/gpsbabel/Makefile.in +++ b/gpsbabel/Makefile.in @@ -40,6 +40,10 @@ RC=@RC@ OUTPUT_SWITCH=-o # QT_INC=@QT_INC@ +QT_LIBS=@QT_LIBS@ +QMAKE=@QMAKE@ +LUPDATE=@LUPDATE@ +LRELEASE=@LRELEASE@ # # Enable either or both of these as you wish. @@ -140,10 +144,10 @@ WEB=@DOCDIR@ all: gpsbabel$(EXEEXT) gpsbabel$(EXEEXT): configure Makefile $(OBJS) @GPSBABEL_DEBUG@ - $(CXX) $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EXPAT_LIB@ @QT_LIBS@ @USB_LIBS@ $(OUTPUT_SWITCH)$@ + $(CXX) $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EXPAT_LIB@ $(QT_LIBS) @USB_LIBS@ $(OUTPUT_SWITCH)$@ gpsbabel-debug: $(OBJS) - $(CXX) $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EFENCE_LIB@ @EXPAT_LIB@ @USB_LIBS@ $(OUTPUT_SWITCH)$@ + $(CXX) $(CFLAGS) $(LDFLAGS) $(OBJS) @LIBS@ @EFENCE_LIB@ @EXPAT_LIB@ $(QT_LIBS) @USB_LIBS@ $(OUTPUT_SWITCH)$@ Makefile gbversion.h: Makefile.in config.status xmldoc/makedoc.in \ gbversion.h.in gui/setup.iss.in @@ -379,9 +383,9 @@ mac-release: curl -u anonymous:anonymous --upload-file gpsbabel-osx.tgz ftp://upload.sf.net/incoming/ gui: gpsbabel - cd gui ; qmake && make - cd gui ; lupdate app.pro - cd gui ; lrelease app.pro + cd gui ; $(QMAKE) && make + cd gui ; $(LUPDATE) app.pro + cd gui ; $(LRELEASE) app.pro linux-gui: gui cd gui; ./makelinuxdist.sh diff --git a/gpsbabel/configure b/gpsbabel/configure index cf0ee26ca..7d88127de 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -636,6 +636,9 @@ OSJEEPS USB_CFLAGS USB_LIBS LIBUSBCONFIG +LRELEASE +LUPDATE +ac_ct_QMAKE QMAKE RC FILEINFO @@ -4341,9 +4344,14 @@ case "$target" in esac +# On RHEL/OEL/SL/CENTOS/FEDORA qmake is from Qt3, and qmake-qt4 is from Qt4. +# If qmake-qt4 isn't found look for the standard name qmake and assume it is +# from a useful version Qt. if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}qmake", so it can be a program name with args. -set dummy ${ac_tool_prefix}qmake; ac_word=$2 + for ac_prog in qmake-qt4 qmake + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_QMAKE+:} false; then : @@ -4359,7 +4367,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_QMAKE="${ac_tool_prefix}qmake" + ac_cv_prog_QMAKE="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4379,11 +4387,15 @@ $as_echo "no" >&6; } fi + test -n "$QMAKE" && break + done fi -if test -z "$ac_cv_prog_QMAKE"; then +if test -z "$QMAKE"; then ac_ct_QMAKE=$QMAKE - # Extract the first word of "qmake", so it can be a program name with args. -set dummy qmake; ac_word=$2 + for ac_prog in qmake-qt4 qmake +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_QMAKE+:} false; then : @@ -4399,7 +4411,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_QMAKE="qmake" + ac_cv_prog_ac_ct_QMAKE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -4418,6 +4430,10 @@ else $as_echo "no" >&6; } fi + + test -n "$ac_ct_QMAKE" && break +done + if test "x$ac_ct_QMAKE" = x; then QMAKE="" else @@ -4429,11 +4445,94 @@ ac_tool_warned=yes ;; esac QMAKE=$ac_ct_QMAKE fi +fi + +for ac_prog in lupdate-qt4 lupdate +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LUPDATE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LUPDATE"; then + ac_cv_prog_LUPDATE="$LUPDATE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LUPDATE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LUPDATE=$ac_cv_prog_LUPDATE +if test -n "$LUPDATE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LUPDATE" >&5 +$as_echo "$LUPDATE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LUPDATE" && break +done + +for ac_prog in lrelease-qt4 lrelease +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LRELEASE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LRELEASE"; then + ac_cv_prog_LRELEASE="$LRELEASE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LRELEASE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LRELEASE=$ac_cv_prog_LRELEASE +if test -n "$LRELEASE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LRELEASE" >&5 +$as_echo "$LRELEASE" >&6; } else - QMAKE="$ac_cv_prog_QMAKE" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$LRELEASE" && break +done + + + QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -l QtCore" case "$target" in *-*-cygwin* | *-*-mingw32*) diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index b3da8b5bd..0b8c92d36 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -151,7 +151,13 @@ case "$target" in esac AC_SUBST(FILEINFO) AC_SUBST(RC) -AC_CHECK_TOOL(QMAKE, qmake) +# On RHEL/OEL/SL/CENTOS/FEDORA qmake is from Qt3, and qmake-qt4 is from Qt4. +# If qmake-qt4 isn't found look for the standard name qmake and assume it is +# from a useful version Qt. +AC_CHECK_TOOLS(QMAKE, [qmake-qt4 qmake]) +AC_CHECK_PROGS(LUPDATE, [lupdate-qt4 lupdate]) +AC_CHECK_PROGS(LRELEASE, [lrelease-qt4 lrelease]) + QT_LIBS="-L$($QMAKE -query QT_INSTALL_LIBS) -l QtCore" case "$target" in diff --git a/gpsbabel/gui/makelinuxdist.sh.in b/gpsbabel/gui/makelinuxdist.sh.in index 94b6e1ff7..bd1f87221 100644 --- a/gpsbabel/gui/makelinuxdist.sh.in +++ b/gpsbabel/gui/makelinuxdist.sh.in @@ -1,7 +1,7 @@ #!/bin/sh set -e -v -QT_INSTALL_PLUGINS=`qmake -query QT_INSTALL_PLUGINS` -QT_INSTALL_TRANSLATIONS=`qmake -query QT_INSTALL_TRANSLATIONS` +QT_INSTALL_PLUGINS=`@QMAKE@ -query QT_INSTALL_PLUGINS` +QT_INSTALL_TRANSLATIONS=`@QMAKE@ -query QT_INSTALL_TRANSLATIONS` DISTNAME=GPSBabel@PACKAGE_VERSION@@PACKAGE_RELEASE@ DISTDIR=$DISTNAME -- 2.30.2